package com.evil.common.application.dto.permission.control;

import com.evil.common.application.enums.form.ControlPermissionSourceTypeEnum;
import lombok.Data;

import java.util.Map;

/**
 * 复制控件权限配置
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@Data
public class CopyControlPermissionReqDTO {

    private Long enterpriseId;

    /**
     * 复制源
     */
    private ControlPermissionSourceDTO source;

    /**
     * 复制目标
     */
    private ControlPermissionSourceDTO target;

    /**
     * 控件id映射
     */
    private Map<Long, Long> controlIdMap;

    public CopyControlPermissionReqDTO(ControlPermissionSourceTypeEnum sourceTypeEnum, Long enterpriseId, Long sourceId, Long targetId, Map<Long, Long> controlIdMap) {
        this.enterpriseId = enterpriseId;
        this.source = new ControlPermissionSourceDTO(sourceTypeEnum, sourceId);
        this.target = new ControlPermissionSourceDTO(sourceTypeEnum, targetId);
        this.controlIdMap = controlIdMap;
    }
}
